import request from '@/utils/request'
import type { CategoryListModel } from '@/api/product/model/CategorySelectorModel'
enum Api {
  //获取一级分类数据接口
  getCategory1IdApi = '/admin/product/getCategory1/',
  //获取二级级分类数据接口
  getCategory2IdApi = '/admin/product/getCategory2/',
  //获取三级分类数据接口
  getCategory3IdApi = '/admin/product/getCategory3/',
}

//获取一级分类数据的接口函数
export const ReqCategoryOneId = () =>
  request.get<any, CategoryListModel>(`${Api.getCategory1IdApi}`)

//获取二级分类数据的接口函数
export const ReqCategoryTwoId = (category1Id: number) =>
  request.get<any, CategoryListModel>(`${Api.getCategory2IdApi}/${category1Id}`)

//获取三级分类数据的接口函数
export const ReqCategoryThreeId = (category2Id: number) =>
  request.get<any, CategoryListModel>(`${Api.getCategory3IdApi}/${category2Id}`)
